package com.dragon.modules.yuegou.api.fallback;

import com.dragon.modules.yuegou.api.YuegouApi;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class YuegouFallback  implements FallbackFactory<YuegouApi> {
    @Setter
    private Throwable cause;

    @Override
    public YuegouApi create(Throwable throwable) {
        this.cause = throwable;
        log.error("微服务接口调用失败： {}", cause);
        return null;
    }
}



